<template>
	<div class="ninewei">
		<div class="top-img">
			<img :src="topimg"/>
		</div>
			<ul class="tuwen-box">
				<li class="list-tuwen" v-for="item in tuwenList">
					<p class="user-top-nine"><span><img :src="item.phone_img"/></span><span v-text="item.store_name"></span><span><i><img src="http://liangzhong.oss-cn-hangzhou.aliyuncs.com/newwap/img/dizhi.png"/></i>{{item.chandi}}</span></p>
					<router-link :to="{name:'nineweiNR',params:{id:item.id}}">
							<div class="tuwen-ctrl">
								<img :src="'http://www.ntyouxuan.com/'+item.lb_img" alt="" />
								<h3 v-text="item.title">图文|尝鲜无不道冬笋，一口鲜美，回味无穷，稍纵即逝</h3>
								<p v-text="item.wz_abstract">智者乐山，仁者乐水，我只追着你的竹笛。山一层，水一层，差点忘了我自己</p>
							</div>
							<div class="list-footer"><span v-text="'价格 ￥'+item.price"></span><!--<span v-text="'出售'+item.sales+'件'"></span>--><span v-if="userStute==1" v-text="'佣金 ￥'+item.commission"></span></div>
					</router-link>
					
				</li>
				<p class="footer-tjk">——— 已经到底啦 ———</p>
			</ul>
			
			<navfot></navfot>
			
	</div>
</template>

<script>
	import nineweicss from '../css/ninewei.css';
	import navfot from '@/components/nav'
	
	var furl = 'http://www.ntyouxuan.com/';
	export default {
		name: 'ninewei',
		data () {
			return {
				userStute:0,
				user:"",
				tuwenList:{},
				topimg:""
			}
		},
		components:{navfot},
		methods:{
			userpro:function(){
				var self=this;
				var user=localStorage.getItem("nt_user");
				var stuta=localStorage.getItem("nt_stute");
				if(user&&stuta){
					this.userStute=stuta;
					this.user=user;
				}else{
					$.ajax({
						type:"get",
						url:furl+"index.php?app=default&act=userinfo",
						success:function(res){
							localStorage.setItem("nt_user",JSON.parse(res).retval.token);
							localStorage.setItem("nt_stute",JSON.parse(res).retval.dst_status);
							self.userpro();
						}
					});
				}
			}
		},
		created:function(){
			this.userpro();
			var self=this;
			$.ajax({
				type:"get",
				url:furl+"index.php?app=grade&act=flavors_ajax",
				success:function(res){
					console.log(JSON.parse(res));
					self.tuwenList=JSON.parse(res).retval.jwsj;
					self.topimg=JSON.parse(res).retval.top_img;
				}
			});
		},
		mounted:function(){
			
		}
	}
</script>

<style>
</style>